<?php

namespace App\Http\Controllers\Manage;

use App\Http\Controllers\Controller;
use App\Models\City;
use App\Models\Hospital;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;

class BloodsugarController extends Controller
{
    protected $request;

    public function __construct(Request $request)
    {
        $this->request = $request;
    }

    public function index()
    {
        $user = $this->request->user();

        $type = ($user->hospital()->getQuery()->first(['type'])->type == 1) ? 'western' : 'chinese';

        return view('manage.index', ['user' => $user, 'type' => $type]);
    }


    public function bloodsugar()
    {

        $type = $this->request->input('type');
        return view('manage.bloodsugar')->with('type',$type);
    }

}
